#ifndef PSEUDOTERMINAL_HPP
#define PSEUDOTERMINAL_HPP
#include "StreamBuffer.hpp"

class PseudoTerminal
{
public:
	PseudoTerminal(int width, int height);
	~PseudoTerminal();
	void sendInput(const char *data, int len);
	bool hasPendingInput();
	void pushInput();
	void setSize(int width, int height);
	void reEnable();
	
	void setAsLogin();
	string getLeftoverInput();
	
	int getMasterFd();
	
protected:
	friend class PtyManager;
	
	StreamBuffer pendingInput;
	
	int masterFd;
	int slaveFd;
	string slaveName;
	bool disabled;
};

#endif
